<{include file="public/header.html"}> 
	<header class="title title-border-sm bj-white">
		<a href="<{eval url('account/baseinfo')}>" class="icon-return iconfont title-left title-top col-red">&#xe604;</a>
		<h1 class="text-center name">个性签名</h1>
	</header>
	<div class="security">
		<ul class="plr15">
			<div class="input-group">
                            <input type="hidden" id="setType" value="signature" />
                            <textarea id="setValue" placeholder="人生就像一杯酒，酸甜苦辣啥都有"><{$signature}></textarea>
			</div>
			<button class="btn mt30 bj-red" id="save-btn" data-valid='保存中'>保存</button>
		</ul>
	</div>
        <script type="text/javascript">
            var flag = true;
            $(function(){
                $("#setValue").focus();
                $("#save-btn").on("click",function(){
                    if(!_is_login()){return;}
                    if(!flag){
                        $.mvalidateTip("操作过于频繁");return;
                    }
                    var _self = $(this),_type = $("#setType").val(),_value = $("#setValue").val(),_valid = _self.attr("data-valid");
                    flag = false;
                    _self.text(_valid);
                    doRequest("/ajax/ajax_modify_baseinfo",{setValue:_value,setType:_type},true,function(data){
                        $.mvalidateTip("保存成功");
                        flag = true;
                        _self.text("保存");
                        setTimeout(function(){
                            window.location.href="/account/baseinfo.html";
                        },1500);
                    },function(data){
                        $.mvalidateTip(data.errorMsg);
                        flag = true;
                        _self.text("重新保存");
                    });
                });
            });
        </script>
<{include file="public/footer.html"}> 